/*
 * @Author: jsopy
 * @Date: 2024-07-08 17:07:04
 * @LastEditTime: 2024-07-08 17:22:01
 * @FilePath: /jsopy-elementplus-second/src/components/ChoosIcon/index.ts
 * @Description:
 *
 */

import { type App } from "vue";

import chooseIcon from "./src/index.vue";

// 加载icons

import * as Icons from "@element-plus/icons-vue";

// 驼峰命名

import { toLine } from "@/utils";
// 让这个组件可以通过use形式使用

export default {
  install(app: App) {
    // 全局注册图标
    // el-icon-xxx
    for (let i in Icons) {
      // 注册全局组件
      // 组件名称为：el-icon-xxx
      console.log(`el-icon${toLine(i)}`);
      app.component(`el-icon${toLine(i)}`, (Icons as any)[i]);
    }
    app.component("ChooseIcon", chooseIcon);
  },
};
